home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Surfer 2.0
/
Internet Surfer 2.0 (Wayzata Technology) (1996).iso
/
pc
/
text
/
search.txt
< prev
next >
Wrap
Text File
|
1996-02-16
|
7KB
|
298 lines
on mouseDown
global gLocation
global xword
global onHit
global onFName
select the clickLine
wait until the mouse is up
if the mouseLoc is not within rect of me then
select empty
exit mouseDown
end if
put word 2 of the clickLine into theLine
-- put theLine
put Line theLine of card field Search into CardNX
put the number of characters of CardNX into icount
put 1 into kc
put empty into fName
repeat until (kc>icount)
if character kc of CardNX is ";" then
put character kc+1 to 100 of CardNX into fName
exit repeat
end if
add 1 to kc
end repeat
put theLine into onHit
find fName in card field FNames
put word 2 of the foundLine into onFName
-- put onFName
-- put CardN
if fName is empty then
-- put "EMPTY"
else
put 1 into searchYes
if " or " is in card field "SearchStr" then
-- answer "OR"
put 0 into searchYes
end if
put gLocation & fName into fpath
-- put fpath
open file fpath
read from file fpath for 32700
put it into cd field Text
close file fpath
put the first word of cd field SearchStr into xx
if searchYes is 1 then
find xx in cd field Text
end if
end if
--Put the Result & " [" & PICT &"]"
end mouseDown
***** prev + next hit
on mouseUp
global onHit
global onFName
global gLocation
if the number of lines of card field Search < 1 then
answer "Sorry there are no search results - first do a search."
exit mouseUp
end if
subtract 1 from onHit
if onHit < 1 then
put the number of lines of card field Search into onHit
end if
put Line onHit of card field Search into CardNX
put the number of characters of CardNX into icount
put 1 into kc
put empty into fName
repeat until (kc>icount)
if character kc of CardNX is ";" then
put character kc+1 to 100 of CardNX into fName
exit repeat
end if
add 1 to kc
end repeat
select line onHit of card field Search
-- put gLocation &fName && onHit && CardNX
set the scroll of card field Text to 0
put gLocation & fName into fpath
open file fpath
read from file fpath for 32700
put it into cd field Text
close file fpath
find fName in card field FNames
put word 2 of the foundLine into onFName
put the first word of cd field SearchStr into xx
put 1 into searchYes
if " or " is in cd Field SearchStr then
put 0 into searchYes
end if
if searchYes is 1 then
find xx in cd field Text
end if
end mouseUp
on mouseUp
global onHit
global onFName
global gLocation
if the number of lines of card field Search < 1 then
answer "Sorry there are no search results - first do a search."
exit mouseUp
end if
add 1 to onHit
if onHit > the number of lines of card field Search then
put 1 into onHit
end if
put Line onHit of card field Search into CardNX
put the number of characters of CardNX into icount
put 1 into kc
put empty into fName
repeat until (kc>icount)
if character kc of CardNX is ";" then
put character kc+1 to 100 of CardNX into fName
exit repeat
end if
add 1 to kc
end repeat
select line onHit of card field Search
set the scroll of card field Text to 0
-- put gLocation &fName && onHit && CardNX
put gLocation & fName into fpath
open file fpath
read from file fpath for 32700
put it into cd field Text
close file fpath
find fName in card field FNames
put word 2 of the foundLine into onFName
put the first word of cd field SearchStr into xx
put 1 into searchYes
if " or " is in cd Field SearchStr then
put 0 into searchYes
end if
if searchYes is 1 then
find xx in cd field Text
end if
end mouseUp
***** prev + next article
on mouseUp
-- global onHit
global onFName
global gLocation
subtract 1 from onFName
if onFName < 1 then
put the number of lines of card field FNames into onFName
end if
put Line onFName of card field FNames into fName
-- put gLocation &fName && onHit && CardNX
set the scroll of card field Text to 0
put gLocation & fName into fpath
open file fpath
read from file fpath for 32700
put it into cd field Text
close file fpath
find fName in card field FNames
put word 2 of the foundLine into onFName
put the first word of xword into xx
if searchYes is 1 then
find xx in cd field Text
end if
end mouseUp
on mouseUp
-- global onHit
global onFName
global gLocation
add 1 to onFName
if onFName > the number of lines of card field FNames then
put 1 into onFName
end if
put Line onFName of card field FNames into fName
-- put gLocation &fName && onHit && CardNX
set the scroll of card field Text to 0
put gLocation & fName into fpath
open file fpath
read from file fpath for 32700
put it into cd field Text
close file fpath
find fName in card field FNames
put word 2 of the foundLine into onFName
put the first word of xword into xx
if searchYes is 1 then
find xx in cd field Text
end if
end mouseUp
***** find WEB
on mouseUp
global xLine
global fLine
-- put xLine
put 1 into notFOUND
-- put the foundLine && "found"
put 0 into k
if "card field 5" is in xLine then
put word 2 of xLine into kScroll
else if "card field 5" is in fLine then
put word 2 of fLine into kScroll
else
put (the scroll of cd field Text div (textSize of cd field Text)) + 1 into kScroll
end if
-- put kScroll
repeat
put Line (kScroll+k) of cd field Text into kLine
-- put kLine
if "http" is in kLine OR "URI" is in kLine OR "ftp" is in kLine then
-- put kLine
select line kScroll+k of card field Text
put the selectedChunk into xCh
put word 2 of xCh into stSel
put word 4 of xCh into endSel
-- put stSel+4 && endSel && "= sel"
select char stSel+4 to endSel of card field Text
doMenu "Copy Text"
-- open "surfer:NetScape 1.1N:Netscape 1.1N"
-- doMenu "Paste"
put 0 into notFOUND
exit repeat
end if
add 1 to k
if k > 30 then
exit repeat
end if
end repeat
if notFOUND is 1 then
answer "Sorry unable to find a WEB address..."
end if
end mouseUp